import { Card, Col, Row, Table, Badge } from 'antd'
import React, {useEffect} from 'react'
import { history } from 'umi'
import './TodoPortal.less'
import {bulletinTypeList} from "@/utils/constant";

const TodoPortal = ({ loading, preInfo,bankCardNum,currentUser }) => {

  const goToPage = (url) => {
    history.push(url);
  };

  return (
    <Card
      loading={loading}
      bordered={false}
      title="待办"
      className="todo-portal"
      style={{height: '100%'}}
    >
      <div className="todo-portal__content">
        {
          (currentUser.menu.indexOf('/personnel/entry/newEmployees') > -1) &&
          <Badge count={preInfo?preInfo.preEntry:''} onClick={() => goToPage('/personnel/entry/newEmployees')} className="todo-portal__item">
            <img className="todo-portal__item-icon" alt='' src={require('@/assets/dairuzhiyuangong-01.svg')}/>
            <div className="todo-portal__item-label">待入职员工</div>
          </Badge>
        }
        {
          (currentUser.menu.indexOf('recruitment/hire') > -1) &&
          <Badge count={preInfo?preInfo.preNew:''} onClick={() => goToPage('/recruitment/hire')} className="todo-portal__item">
          <img className="todo-portal__item-icon" alt='' src={require('@/assets/luyong.svg')}/>
          <div className="todo-portal__item-label">待录用员工</div>
          </Badge>
        }
        {
          (currentUser.menu.indexOf('salary/bankcard') > -1) &&
          <Badge count={bankCardNum?bankCardNum:''} onClick={() => goToPage('/salary/bankcard')} className="todo-portal__item">
          <img className="todo-portal__item-icon" alt='' src={require('@/assets/gongzikayidong.svg')}/>
          <div className="todo-portal__item-label">工资卡异动</div>
          </Badge>
        }

        {/*<Badge count={preInfo?preInfo.preRegular:''} className="todo-portal__item">*/}
        {/*  <img className="todo-portal__item-icon" alt='' src={require('@/assets/daizhuanzheng-01.svg')}/>*/}
        {/*  <div className="todo-portal__item-label">待转正员工</div>*/}
        {/*</Badge>*/}
        {/*<Badge count={preInfo?preInfo.preSalary:''} className="todo-portal__item">*/}
        {/*  <img className="todo-portal__item-icon" alt='' src={require('@/assets/daidingxinyuangong-01.svg')}/>*/}
        {/*  <div className="todo-portal__item-label">待定薪员工</div>*/}
        {/*</Badge>*/}

        {/*<Badge count={preInfo?preInfo.preContract:''} className="todo-portal__item">*/}
        {/*  <img className="todo-portal__item-icon" alt='' src={require('@/assets/daihetongqianyue-01.svg')}/>*/}
        {/*  <div className="todo-portal__item-label">待合同续签员工</div>*/}
        {/*</Badge>*/}
        <Badge count={preInfo?preInfo.preDimission:''} onClick={() => goToPage('/personnel/resignation/list')} className="todo-portal__item">
          <img className="todo-portal__item-icon" alt='' src={require('@/assets/dailizhiyuangong-01.svg')}/>
          <div className="todo-portal__item-label">待离职员工</div>
        </Badge>
        {/*<Badge count={preInfo?preInfo.preAnniversary:''} className="todo-portal__item">*/}
        {/*  <img className="todo-portal__item-icon" alt='' src={require('@/assets/benzhounianqingyuangong-01.svg')}/>*/}
        {/*  <div className="todo-portal__item-label">本月周年庆员工</div>*/}
        {/*</Badge>*/}
        {/*<Badge count={preInfo?preInfo.preBirthday:''} className="todo-portal__item">*/}
        {/*  <img className="todo-portal__item-icon" alt='' src={require('@/assets/benyueyuangongshengr-01.svg')}/>*/}
        {/*  <div className="todo-portal__item-label">本月生日庆员工</div>*/}
        {/*</Badge>*/}
      </div>
    </Card>
  )
};

export default TodoPortal
